package com.beiing.tianshuai.tianshuai.mine.presenter;

import com.beiing.tianshuai.tianshuai.mine.entity.OrderUserAddressEditDataBean;
import com.beiing.tianshuai.tianshuai.mine.model.OrderAddressEditModel;
import com.beiing.tianshuai.tianshuai.mine.model.OrderAddressEditModelImpl;
import com.beiing.tianshuai.tianshuai.mine.view.OrderAddressEditViewImpl;

/**
 * Created by Administrator on 2018/4/13.
 */

public class OrderAddressEditPresenter implements OrderAddressEditPresenterImpl,
        OrderAddressEditModel.OrderUserAddressEditDataResponseListener {

    private OrderAddressEditViewImpl mView;
    private OrderAddressEditModelImpl mModel;

    public OrderAddressEditPresenter(OrderAddressEditViewImpl view) {
        mView = view;
        mModel = new OrderAddressEditModel(this);
    }

    @Override
    public void getUserAddressAdd(String userId, String username, String telephone,
                                  String province, String city, String county, String address,
                                  String label, String def) {
        mView.showProgress();
        mModel.getUserAddressAdd(userId, username, telephone,
                province, city, county, address, label, def);
    }

    @Override
    public void getUserAddressChange(String userId, String addressId, String username,
                                     String telephone, String province, String city, String county,
                                     String address, String label, String def) {
        mView.showProgress();
        mModel.getUserAddressChange(userId, addressId, username, telephone,
                province, city, county, address, label, def);
    }


    @Override
    public void onGetDetailSuccess(OrderUserAddressEditDataBean bean) {
        //请求成功返回
        mView.hideProgress();
        mView.getOrderAddressEditSuccess(bean);
    }

    @Override
    public void onGetDetailError(Throwable throwable) {

    }
}
